/*
 *      kernel_netbook.h
 *      
 *      Copyright 2009 AzureSky <AzureSky.fedora@gmail.com>
 *      
 *      This program is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 2 of the License, or
 *      (at your option) any later version.
 *      
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *      
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */

#ifndef _KERNEL_NOTEBOOK_H_
#define _KERNEL_NOTEBOOK_H_

#include <glibmm.h>
#include <gtkmm.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/sysctl.h>
#include <iostream>
#include "../sysctl/kernel.h"
#include "../sysctl/network.h"
#include "../sysctl/vm.h"
#include "../sysctl/filesystem.h"

class kernel_notebook : public Gtk::Notebook
{
	public:
		kernel_notebook(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& refGlade);
		~kernel_notebook();
	
		const Glib::RefPtr<Gtk::Builder>& refXml;
	private:
		/*notebook: kernel */
		void kernel_page();
		
		void change_ctrl_alt_del();
		void change_threads_max();
		void change_panic();
		
		void change_msgmax();
		void change_msgmnb();
		void change_msgmni();
		
		void change_shmall();
		void change_shmmax();
		void change_shmmni();
		
		kernel_opt kernel;
		
		Gtk::CheckButton* ctl_alt_del;
		
		Gtk::SpinButton* threads;
		Gtk::SpinButton* panic;
		
		Gtk::SpinButton* msgmax;
		Gtk::SpinButton* msgmnb;
		Gtk::SpinButton* msgmni;
		
		Gtk::SpinButton* shmall;
		Gtk::SpinButton* shmmax;
		Gtk::SpinButton* shmmni;

		/*notebook: vm */
		void vm_page();
		
		void change_swap();
		
		vm_opt vm;
		
		Gtk::HScale* swap_scale;
		
		/*notebook: filesystem */
		void filesys_page();
		
		void change_max_file();
		
		filesys_opt filesys;
		
		Gtk::SpinButton* max_file;

		/*notebook: network */
		void net_page();
		
		void change_sack();
		void change_fack();
		void change_forward();
		void change_win_scal();
		void change_time_out();
		void change_low_latency();
		
		void change_rmem_default();
		void change_rmem_max();
		void change_wmem_default();
		void change_wmem_max();
		
		void change_tcp_mem();
		void change_tcp_rmem();
		void change_tcp_wmem();
		
		
		net_opt net_work;
		
		Gtk::CheckButton* sack;
		Gtk::CheckButton* fack;
		Gtk::CheckButton* ip_forward;
		Gtk::CheckButton* win_scal;
		Gtk::CheckButton* time_out;
		Gtk::CheckButton* low_latency;
		
		Gtk::SpinButton* rmem_default;
		Gtk::SpinButton* rmem_max;
		Gtk::SpinButton* wmem_default;
		Gtk::SpinButton* wmem_max;
		
		Gtk::SpinButton* tcp_mem_min;
		Gtk::SpinButton* tcp_mem_default;
		Gtk::SpinButton* tcp_mem_max;
		
		Gtk::SpinButton* tcp_wmem_min;
		Gtk::SpinButton* tcp_wmem_default;
		Gtk::SpinButton* tcp_wmem_max;
		
		Gtk::SpinButton* tcp_rmem_min;
		Gtk::SpinButton* tcp_rmem_default;
		Gtk::SpinButton* tcp_rmem_max;

};

#endif //_KERNEL_NOTEBOOK_H_
